package com.mygdx.screen;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.mygdx.contact.CommonContact;
import com.mygdx.game.MyGdxGame;

/**
 * @Title: StartScreen
 * @Author RuoLi
 * @Package com.mygdx.screen
 * @Date 2023/12/17 15:20
 * @description: 游戏开始界面
 */
public class StartScreen implements Screen {
    MyGdxGame game;
    Stage stage;
    CommonActor commonActor;
    public StartScreen(MyGdxGame game) {
        this.game = game;
        stage = new Stage();
        commonActor = new CommonActor();

        commonActor.createTextButton(Gdx.graphics.getWidth()/2f-32f,100f, CommonContact.START.name());
        stage.addActor(commonActor.addActorTextButton());
    }

    @Override
    public void show() {

    }

    @Override
    public void render(float delta) {
        Gdx.gl.glClearColor(0, 0, 0, 1);
        Gdx.gl.glClear(Gdx.gl20.GL_COLOR_BUFFER_BIT);
        commonActor.render();
        stage.act();
        stage.draw();
    }

    @Override
    public void resize(int width, int height) {

    }

    @Override
    public void pause() {

    }

    @Override
    public void resume() {

    }

    @Override
    public void hide() {

    }

    @Override
    public void dispose() {

    }
}
